package edu.sctu.practice.class02.zhaozhongjun.assign3.a1;

/**
 * Created by zhao on 2015/11/5.
 */
public class Circle extends GeometricObject {
    protected double radius;

    public Circle() {

        this(1.0, "white", 1.0);
    }

    public Circle(double radius) {

        super("white", 1.0);
        this.radius = radius;
    }

    public Circle(double radius, String color, double weight) {

        super(color, weight);
        this.radius = radius;
    }

    public double getRadius() {

        return radius;
    }

    public void setRadius(double radius) {

        this.radius = radius;
    }

    public double findArea() {

        return radius * radius * Math.PI;
    }

    public double findPerimeter() {

        return 2 * radius * Math.PI;
    }

    public boolean equals(Circle circle)

    {

        return this.radius == circle.getRadius();
    }

    public String toString() {

        return "圆的半径= " + radius;
    }
}


